package cn.bj.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.bj.beans.Yxhq;
import cn.bj.dao.YxhqMapper;

@Service
public class YxhqService {
	@Autowired
	YxhqMapper yxhqMapper;

	// 查询所有
	public List<Yxhq> getAllYxhq() {
		return yxhqMapper.selectByExample(null);
	}

	// 插入
	public int insrtYxhq(Yxhq yxhq) {
		return yxhqMapper.insert(yxhq);
	}

	// 删除
	public int deleteYxhq(Integer id) {
		return yxhqMapper.deleteByPrimaryKey(id);
	}

	// 查询单个信息
	public Yxhq selectById(Integer id) {
		return yxhqMapper.selectByPrimaryKey(id);
	}

	// 修改
	public int updateYxhq(Yxhq yxhq) {
		return yxhqMapper.updateByPrimaryKey(yxhq);
	}

}
